package io.renren.modules.hospital.service.impl;

import io.renren.modules.hospital.entity.MedicalWithPatientEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.hospital.dao.BlDao;
import io.renren.modules.hospital.entity.BlEntity;
import io.renren.modules.hospital.service.BlService;


@Service("blService")
public class BlServiceImpl extends ServiceImpl<BlDao, BlEntity> implements BlService {

    @Autowired
    BlDao blDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<BlEntity> page = this.page(
                new Query<BlEntity>().getPage(params),
                new QueryWrapper<BlEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<BlEntity> getMedicalByYsId(int ysId) {
        return blDao.getMedicalByYsId(ysId);
    }

    @Override
    public List<MedicalWithPatientEntity> getMedicalWithPatientInfo(Integer ysId) {
        return blDao.getMedicalWithPatientInfo(ysId);
    }

    @Override
    public List<MedicalWithPatientEntity> getTodayMedical(Integer ysId) {
        return blDao.getTodayMedical(ysId);
    }

}
